#include<iostream>
using namespace std;
typedef long long LL;
LL n, k;
int main()
{
	cin >> n >> k;
	while (k--) {
		if (n % 10 == 0) {
			n /= 10;
		}
		else {
			n -= 1;
		}
	}
	cout << n << endl;
	return 0;
}